#ifndef PRIMITIVEARRAY_H_INCLUDED
#define PRIMITIVEARRAY_H_INCLUDED

//predecl

//includes
#include <boost/intrusive/list.hpp>
#include <General/cvMemory.h>

namespace cvRenderInterface
{

	/**
	 *	@class Primitive array is an data type that contains fixed amount of primitives.
	 *	The type is split to Base and templated derived type so we can safely cast
	 *	any derived type to base.
	 */

	class PrimitiveArrayBase
	{
		public:
			// list hook.
			boost::intrusive::list_member_hook<> m_hook;
			size_t m_count;
	};

	template<typename T, size_t elements>
	class PrimitiveArray : public PrimitiveArrayBase
	{
		public:
			bool m_used[elements];		// which slots are in use or unused?
			T m_primitives[elements];	// the primitive data
	};
}

#endif // PRIMITIVEARRAY_H_INCLUDED
